<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <c:set var="prc" value="${pageContext.request.contextPath }"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员</title>
<style>
* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background: #494A5F;
	font-weight: 500;
	font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande",
		Helvetica, Arial, sans-serif, FreeSans, Arimo;
}

div.search {
	padding-top: 100px;
	padding-bottom: 20px;
}

form {
	position: relative;
	width: 300px;
	margin: 0 auto;
}

input, button {
	border: none;
	outline: none;
}

input {
	width: 100%;
	height: 42px;
	padding-left: 13px;
}

button {
	height: 42px;
	width: 42px;
	cursor: pointer;
	position: absolute;
}
/*搜索框7*/
.bar7 {
	background: #7BA7AB;
}

.bar7 form {
	height: 42px;
	margin: 0 auto;
}

.bar7 input {
	width: 250px;
	border-radius: 42px;
	border: 2px solid #324B4E;
	background: #F9F0DA;
	transition: .3s linear;
	float: right;
}

.bar7 input:focus {
	width: 300px;
}

.bar7 button {
	background: none;
	top: -2px;
	right: 0;
}

.bar7 button:before {
	content: "\f002";
	font-family: FontAwesome;
	color: #324b4e;
}

* {
	margin: 0;
	padding: 0;
	text-decoration: none;
	list-style: none;
	box-sizing: border-box;
}

body {
	text-align: center;
}

html {
	font-size: 10px;
}

.cont {
	width: 1000px;
	height: 100%;
	overflow: auto; /*border:solid 1px #ccc;*/
	margin: 0px auto;
} /* 这是左边栏部分开始*/
.cont .left-nav {
	width: 200px; /*border:solid 1px #f00;*/
	float: left;
} /* 导航效果1开始*/
.cont .left-nav ul li ul {
	display: none;
}

.cont .left-nav ul li:hover ul {
	display: block;
	margin: -5px 0px 0px 0px;
	border-left: solid 1px #ccc;
	border-right: solid 1px #ccc;
	border-bottom: solid 1px #ccc;
}

.cont .left-nav ul li a {
	display: block;
	padding: 5px 10px;
	background: #eee;
	margin: 0px 0px 5px 0px;
	border: solid 1px #ccc;
	border-radius: 3px;
}

.cont .left-nav ul li:hover ul li a {
	display: block;
	padding: 5px 10px;
	background: #fff;
	border: none;
	margin: 0px 0px 5px 0px;
}

.cont .left-nav ul li:hover ul li a:hover {
	background: #ddd;
}

.cont .left-nav ul li span {
	font-weight: bold;
	float: right;
} /* 导航效果1结束*/ /* 这是左边栏部分结束*/ /*这是右边部分*/
.cont .right-d {
	width: 780px;
	background: #ccc;
	float: left;
	margin: 0px 0px 0px 10px;
	padding: 15px 0px 20px 0px;
}

.cont .right-d .dd-out {
	width: 95%;
	border: solid 1px #ccc;
	padding: 0px 10px 50px 150px;
	background: #fff;
	border-radius: 30px;
	display: inline-block;
	 vertical-align:middle;
}
table{
	/*border: 1px solid;*/
}
table,th{
	/*border: 1px solid;*/
	padding-left: 60px;
	
}
table,td{
	/*border: 1px solid;*/
	padding-left: 30px;
	
}


#paging {
	margin: 0 auto;
	width: 50%;
	height: 100px;
	/*border: 1px solid red;*/
	text-align: center;
	margin-top: 300px;
}

ul.pagination li {
	list-style-type: none;
	display: inline;
}

ul.pagination li a {
	text-decoration: none;
	color: black;
	padding: 8px 10px; /*10px左右内边距， 8px上下内边距*/
	border: 1px solid darkgray;
	border-radius: 20px;
}

ul.pagination li a.active {
	background: green;
	color: white;
}

/*如果类名不为active并且鼠标经过才显示的样式*/
ul.pagination li a:hover:not (.active ) {
	background: darkseagreen;
	border: 1px solid green;
	font-size: 19px;
}
</style>
</head>
<body>
<%@include file="header.jsp"%>

	<div class="search bar7">
		
	</div>
		<div class="cont">
		<div class="left-nav">
			<ul>
				<li><a href="#">动态管理<span>&gt;</span></a>
					<ul>
						<li><a href="Strategy">已发布拾光动态</a></li>
						<li><a href="#">退出</a></li>
					</ul></li>
				<li><a href="#">用户功能<span>&gt;</span></a>
					<ul>
						<li><a href="User">所有用户信息</a></li>
						<li><a href="upUser">用户升级商家</a></li>
						<li><a href="#">退出</a></li>
					</ul></li>
			</ul>
		</div>
 		<div class="right-d">
			<div  class="dd-out">
			
			<c:if test="${User.list!=null}">
				<table>
			<caption>用户信息</caption>
			<tr>
				<th scope="col">用户名</th>
				<th scope="col">用户密码</th>
				<th scope="col">用户邮箱</th>
				<th scope="col">管理</th>
			</tr>
			<c:forEach items="${User.list}" var="u">
					<<tr>
					<td>${u.username }</td>
					<td>${u.password }</td>
					<td>${u.email}</td>
					<td><a href="deleteUser?id=${u.id}">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		</c:if>
		
		<c:if test="${upUser.list!=null}">
				<table>
			<caption>用户信息</caption>
			<tr>
				<th scope="col">用户名</th>
				<th scope="col">状态</th>
			    <th scope="col">店铺名称</th>
				<th scope="col">图片审核</th>
				<th scope="col">管理</th>
			</tr>
			<c:forEach items="${upUser.list}" var="p">
					<tr>
					<td>${p.username }</td>
					<td>${p.status }</td>
					<td>${p.shopname }</td>
					<td><img src="img/${p.img}" width="200" height="150"class="img-rounded"/></td>
					<td><a href="sUser/${p.id}">升级</a></td>
				</tr>
			</c:forEach>
		</table>
		</c:if>	
		<c:if test="${findAllStrategy1.list!=null}">
				<table>
			<caption>用户信息</caption>
			<tr>
				<th scope="col">主题</th>
				<th scope="col">景点</th>
				<th scope="col">图片列表</th>
				<th scope="col">发布用户</th>
				<th scope="col">管理</th>
			</tr>
			<c:forEach items="${findAllStrategy1.list}" var="s">
					<tr>
					<td>${s.themes }</td>
					<td>${s.address }</td>
					<c:forEach var="listimg" begin="0" end="1" step="3" items="${s.listimg }">
					<td><img src="${prc }/img/${listimg.img}" width="200" height="150"class="img-rounded"/></td>
					</c:forEach>
					<td>${s.user.username}</td>
					<td><a href="deleteStrategy?id=${s.id}">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		</c:if>

			</div>	
		</div>
	</div>
	<div id="paging">
	<ul class="pagination">
		 <c:if test="${findAllStrategy1.pageNum>=2}">
			<li><a href="Strategy?pageNum=1&&pageSize=${findAllStrategy1.pageSize }">首页</a></li>
			<li><a href="Strategy?pageNum=${findAllStrategy1.prePageNum}&&pageSize=${findAllStrategy1.pageSize }">上一页</a></li>
			<li><a >...</a></li>
			<li><a href="Strategy?pageNum=${findAllStrategy1.prePageNum}&&pageSize=${findAllStrategy1.pageSize }">${findAllStrategy1.prePageNum}</a></li>
			</c:if>
			<li><a class="active" >${findAllStrategy1.pageNum}</a></li>
			<c:if test="${findAllStrategy1.pageNum<findAllStrategy1.totalPageNum}">
			<li><a href="Strategy?pageNum=${findAllStrategy1.nextPageNum}&&pageSize=${findAllStrategy1.pageSize }">${findAllStrategy1.nextPageNum}</a></li>
			<li><a >...</a></li>
			<li><a href="Strategy?pageNum=${findAllStrategy1.nextPageNum}&&pageSize=${findAllStrategy1.pageSize }">下一页</a></li>
			<li><a href="Strategy?pageNum=${findAllStrategy1.totalPageNum}&&pageSize=${findAllStrategy1.pageSize }">尾页</a></li>
			</c:if>
			
			
			<c:if test="${User.pageNum>=2}">
			<li><a href="User?pageNum=1&&pageSize=${User.pageSize }">首页</a></li>
			<li><a href="User?pageNum=${User.prePageNum}&&pageSize=${User.pageSize }">上一页</a></li>
			<li><a >...</a></li>
			<li><a href="User?pageNum=${User.prePageNum}&&pageSize=${User.pageSize }">${User.prePageNum}</a></li>
			</c:if>
			<li><a class="active" >${User.pageNum}</a></li>
			<c:if test="${User.pageNum<User.totalPageNum}">
			<li><a href="User?pageNum=${User.nextPageNum}&&pageSize=${User.pageSize }">${User.nextPageNum}</a></li>
			<li><a >...</a></li>
			<li><a href="User?pageNum=${User.nextPageNum}&&pageSize=${User.pageSize }">下一页</a></li>
			<li><a href="User?pageNum=${User.totalPageNum}&&pageSize=${User.pageSize }">尾页</a></li>
			</c:if>
			
			
			<c:if test="${upUser.pageNum>=2}">
			<li><a href="upUser?pageNum=1&&pageSize=${upUser.pageSize }">首页</a></li>
			<li><a href="upUser?pageNum=${upUser.prePageNum}&&pageSize=${upUser.pageSize }">上一页</a></li>
			<li><a >...</a></li>
			<li><a href="upUser?pageNum=${upUser.prePageNum}&&pageSize=${upUser.pageSize }">${upUser.prePageNum}</a></li>
			</c:if>
			<li><a class="active" >${upUser.pageNum}</a></li>
			<c:if test="${upUser.pageNum<upUser.totalPageNum}">
			<li><a href="upUser?pageNum=${upUser.nextPageNum}&&pageSize=${upUser.pageSize }">${upUser.nextPageNum}</a></li>
			<li><a >...</a></li>
			<li><a href="upUser?pageNum=${upUser.nextPageNum}&&pageSize=${upUser.pageSize }">下一页</a></li>
			<li><a href="upUser?pageNum=${upUser.totalPageNum}&&pageSize=${upUser.pageSize }">尾页</a></li>
			</c:if>
			
			</ul> 
	</div>
</body>
</html>